The agent trigger "After new mail arrives" is precisely that: a trigger. Your code still needs to say what you want the Notes server to do. I assume you mean that for each new mail that arrives, your code should do something to that mail. Fine. But it also needs to set the document as having been processed once the work's done so that it doesn't get processed again. If you're using Lotusscript, then read the Domino Designer help on the NotesDatabase property "UnprocessedDocuments" as this can tell you more. For example:
Using UpdateProcessedDoc
For agents that run on new and modified documents, newly received mail documents, pasted documents, or newly modified documents, you must use the UpdateProcessedDoc method in NotesSession to mark each document as "processed," which ensures that a document gets processed by the agent only once (unless it's modified, mailed, or pasted again). If you do not call this method for each document, the agent processes the same documents the next time it runs.
So, if your code does something like this:
Dim session As New NotesSession
Dim db As NotesDatabase
Dim dc As NotesDocumentCollection
Set dc = db.UnprocessedDocuments
Set doc = dc.GetFirstDocument
While Not(doc Is Nothing)
...
... before you move on to the next document at the end of the loop, you need to do something like this:
Call session.UpdateProcessedDoc(doc)
Hope that helps
--
http://www.benpoole.com